package com.jeeplus.modules.monitor.task;

import com.jeeplus.common.utils.SpringContextHolder;
import com.jeeplus.modules.ap.entity.DayDetil;
import com.jeeplus.modules.ap.entity.Detil;
import com.jeeplus.modules.ap.mapper.DayDetilMapper;
import com.jeeplus.modules.ap.mapper.DetilMapper;
import com.jeeplus.modules.infor.entity.Goods;
import com.jeeplus.modules.infor.entity.Project;
import com.jeeplus.modules.infor.mapper.GoodsMapper;
import com.jeeplus.modules.infor.mapper.ProjectMapper;
import com.jeeplus.modules.tms.entity.*;
import com.jeeplus.modules.tms.mapper.*;
import org.quartz.DisallowConcurrentExecution;

import com.jeeplus.modules.monitor.entity.Task;
import org.springframework.jdbc.core.JdbcTemplate;

import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;

@DisallowConcurrentExecution  
public class TestTask extends Task{

		private static JdbcTemplate jdbc = SpringContextHolder.getBean(JdbcTemplate.class);
		private static DayDetilMapper dayDetilMapper = SpringContextHolder.getBean(DayDetilMapper.class);

		@Override

		public void run() {

			for(Map<String,Object> m:jdbc.queryForList("select * from ap_yue")){
				DayDetil d=new DayDetil();
				d.setDate(new Date());
				d.setPro(m.get("pro")+"");
				d.setJyxj(m.get("xj")+"");
				d.setJyyk(m.get("yk")+"");
				d.setZjy(m.get("zje")+"");
				d.setId(UUID.randomUUID().toString().replaceAll("-",""));
				dayDetilMapper.insert(d);
			}
		}

	}